# Create dataframe with spectral and chromatographic info
sample_spectrums <- process_srm_batch(
input = ms_data_path,
mrm_info = read_csv(mrm_file_path, show_col_types = FALSE)
) %>%
# Append sample metadata from file name
mutate(
# Extract temperature (number before c_)
temperature = as.numeric(str_extract(file_name, "\\d+(?=c_)")),
# Extract ce (number before ce)
ce = as.numeric(str_extract(file_name, "\\d+(?=ce)")),
# Create sample_name combining temperature and energy
sample_name = paste0(temperature, "C_", ce, "eV"),
# Convert to ordered factor
sample_name = factor(
sample_name,
levels = paste0(
rep(c(200, 285), each = 4),
"C_",
rep(c(5, 23, 42, 60), times = 2),
"eV"
),
ordered = TRUE
)
)